package demo.listener.spring;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

// 引用关系：MyEventListener——MyCustomEvent
// 引用关系：MyEventPublisher——MyCustomEvent
@Component
public class MyEventListener {

    @EventListener
    public void handleCustomEvent(MyCustomEvent event) {
        System.out.println("Received custom event - " + event.getMessage());
    }
}